Attribute VB_Name = "Module_VendLoss"
Function InsertData(v As VisM, ByVal loc As String, ByVal vendor As String, _
                    ByVal amount As String, ByVal billno As String) As String
    v.P1 = loc
    v.P2 = vendor
    v.P3 = amount
    v.P4 = gname
    v.P5 = billno
    v.Execute "$$Inser^DHCSTVENDORLOSS(P1,P2,P3,P4,P5)"
    If v.Error <> 0 Then
        MsgBox "error" + v.ErrorName
        InsertData = ""
        Exit Function
    End If
    
    InsertData = v.Value
End Function
Function UpdateData(v As VisM, ByVal dr As String, ByVal vendor As String, _
                    ByVal amount As String, ByVal billno As String) As String
    v.P0 = dr
    v.P1 = vendor
    v.P2 = amount
    v.P3 = gname
    v.P4 = billno
    v.Execute "$$Update^DHCSTVENDORLOSS(P0,P1,P2,P3,P4)"
    If v.Error <> 0 Then
        MsgBox "error" + v.ErrorName
        UpdateData = 1
    End If
    UpdateData = v.Value
End Function
Function DeleteData(v As VisM, ByVal dr As String) As String
    v.P1 = dr
    v.Execute "$$Delete^DHCSTVENDORLOSS(P1)"
    If v.Error <> 0 Then
        MsgBox "error" + v.ErrorName
        DeleteData = 1
    End If
    DeleteData = v.Value
End Function
